home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc1_2_x / stabilzr.sit / The Stabilizer / background_3309.txt < prev    next >
Text File  |  1989-02-05  |  17KB  |  617 lines

  1. -- background: 3309 from stack: in
  2. -- bmap block id: 3042
  3. -- flags: 4000
  4. -- background id: 0
  5. -- name: 
  6. ----- HyperTalk script -----
  7. on openCard
  8.   get the number of lines of field 1
  9.   add the number of lines of field 3 to it
  10.   if it > 30 then
  11.     answer "You have more than 30 items this month." with "Help" or "Delete Item"
  12.     if it = "Delete Item" then
  13.       send mouseUp to bkgnd button "Delete Item"
  14.     else
  15.       show field "ThirtyPlus"
  16.     end if
  17.   end if
  18. end openCard
  19.  
  20. on closeCard
  21.   hide field "ThirtyPlus"
  22. end closeCard
  23.  
  24. on doMonth
  25.   put the mouseloc into listHere
  26.   put item 1 of listHere + 1 into horiz
  27.   put item 2 of listHere - 10 into vert
  28.   put card field "monthList" of card "Expenses" into theList
  29.   get PopUpMenu(theList, 1, vert, horiz)
  30.   put item it of theList into whatCard
  31.   if it Γëá empty then
  32.     visual barn door close slowly to gray
  33.     visual barn door open slowly
  34.     go card whatCard
  35.   else
  36.     exit doMonth
  37.   end if
  38. end doMonth
  39.  
  40.  
  41.  
  42. -- part 29 (field)
  43. -- low flags: 01
  44. -- high flags: 4002
  45. -- rect: left=20 top=56 right=297 bottom=181
  46. -- title width / last selected line: 0
  47. -- icon id / first selected line: 0 / 0
  48. -- text alignment: 0
  49. -- font id: 3
  50. -- text size: 12
  51. -- style flags: 0
  52. -- line height: 16
  53. -- part name: expense
  54. ----- HyperTalk script -----
  55. on mouseDown
  56.   seeItems
  57. end mouseDown
  58.  
  59.  
  60.  
  61. -- part 30 (field)
  62. -- low flags: 01
  63. -- high flags: 4002
  64. -- rect: left=180 top=56 right=297 bottom=256
  65. -- title width / last selected line: 0
  66. -- icon id / first selected line: 0 / 0
  67. -- text alignment: 65535
  68. -- font id: 3
  69. -- text size: 12
  70. -- style flags: 0
  71. -- line height: 16
  72. -- part name: amount
  73.  
  74.  
  75. -- part 59 (field)
  76. -- low flags: 01
  77. -- high flags: 4002
  78. -- rect: left=256 top=56 right=297 bottom=417
  79. -- title width / last selected line: 0
  80. -- icon id / first selected line: 0 / 0
  81. -- text alignment: 0
  82. -- font id: 3
  83. -- text size: 12
  84. -- style flags: 0
  85. -- line height: 16
  86. -- part name: expense2
  87. ----- HyperTalk script -----
  88. on mouseDown
  89.   seeItems
  90. end mouseDown
  91.  
  92.  
  93. -- part 60 (field)
  94. -- low flags: 01
  95. -- high flags: 4002
  96. -- rect: left=416 top=56 right=297 bottom=492
  97. -- title width / last selected line: 0
  98. -- icon id / first selected line: 0 / 0
  99. -- text alignment: 65535
  100. -- font id: 3
  101. -- text size: 12
  102. -- style flags: 0
  103. -- line height: 16
  104. -- part name: amount2
  105.  
  106.  
  107. -- part 61 (field)
  108. -- low flags: 01
  109. -- high flags: 0002
  110. -- rect: left=55 top=18 right=37 bottom=148
  111. -- title width / last selected line: 0
  112. -- icon id / first selected line: 0 / 0
  113. -- text alignment: 1
  114. -- font id: 0
  115. -- text size: 12
  116. -- style flags: 0
  117. -- line height: 16
  118. -- part name: monthName
  119. ----- HyperTalk script -----
  120. on mouseDown
  121.   doMonth
  122. end mouseDown
  123.  
  124.  
  125.  
  126. -- part 64 (button)
  127. -- low flags: 00
  128. -- high flags: A002
  129. -- rect: left=280 top=18 right=37 bottom=370
  130. -- title width / last selected line: 0
  131. -- icon id / first selected line: 0 / 0
  132. -- text alignment: 1
  133. -- font id: 0
  134. -- text size: 12
  135. -- style flags: 0
  136. -- line height: 16
  137. -- part name: Delete Item
  138. ----- HyperTalk script -----
  139. --Copyright ┬⌐1988 - Scott McGilliard - all rights reserved
  140.  
  141. on mouseUp
  142.   if the optionKey is down then
  143.     answer "Delete all the expense items?" with "Cancel" or "OK"
  144.     if it = "OK" then
  145.       push this card
  146.       set lockScreen to true
  147.       put line 3 of card field "startMonth" of card "Year Totals" into adjust
  148.       repeat with i = 2 to the number of items in adjust
  149.         get item i of adjust
  150.         go card it
  151.         if the result = empty then doMenu "Delete Card"
  152.       end repeat
  153.       pop card
  154.       put empty into card field "allExpenses" of card "whichMonths"
  155.       put empty into card field "startMonth" of card "Year Totals"
  156.       noMore
  157.       put "This will take a couple of minutes, please wait."
  158.       repeat with i = 1 to 2
  159.         put empty into card field i of card "printList"
  160.       end repeat
  161.       repeat with i = 1 to 9
  162.         put empty into card field i of card "printTotals"
  163.       end repeat
  164.       repeat with i = 1 to 6
  165.         put empty into card field i of card "printMonths2"
  166.       end repeat
  167.       repeat with i = 1 to 6
  168.         put empty into card field i of card "printMonths"
  169.       end repeat
  170.       doMath
  171.     else
  172.       exit mouseUp
  173.     end if
  174.   else
  175.     set loc of msg to 18,15
  176.     put "Please click on the expense item you want deleted"
  177.     set cursor to 3
  178.     repeat until the mouse is down
  179.     end repeat
  180.     put item 1 of the mouseLoc into temp1
  181.     put item 2 of the mouseLoc into temp2
  182.     if temp1 > 181 and temp1 < 256 then
  183.       hide msg
  184.       exit mouseUp
  185.     end if
  186.     if temp1 < 20 or temp1 >417 then
  187.       hide msg
  188.       exit mouseUp
  189.     end if
  190.     if temp1 >= 20 and temp1 <= 181 then
  191.       put "expense" into whichField
  192.     else
  193.       if temp1 >= 256 and temp1 <= 417 then
  194.         put "expense2" into whichField
  195.       end if
  196.     end if
  197.     put card field "allExpenses" of card "whichMonths" into allExpenses
  198.     put (temp2 - 39) div 16 into whichLine
  199.     put line whichLine of field whichField into whatExpense
  200.     if whatExpense Γëá empty then
  201.       answer "Delete expense item..." && whatExpense &&"?" with "Cancel" or "OK"
  202.       if it = "Cancel" then put empty into whatExpense
  203.     end if
  204.     if whatExpense = empty then
  205.       hide msg
  206.       exit mouseUp
  207.     end if
  208.     set cursor to 4
  209.     set loc of msg to 19,106
  210.     put "Please wait"
  211.     repeat with i = 1 to the number of lines in allExpenses
  212.       if whatExpense = item 1 of line i of allExpenses then
  213.         delete line i of card field "allExpenses" of card "whichMonths"
  214.         exit repeat
  215.       end if
  216.     end repeat
  217.     if whatExpense is in line 3 of card field "startMonth" of card "Year Totals" then
  218.       push this card
  219.       set lockScreen to true
  220.       put line 3 of card field "startMonth" of card "Year Totals" into adjust
  221.       repeat with i = 2 to the number of items in adjust
  222.         if whatExpense = item i of adjust then delete item i of line 3 of card field "startMonth" of card "Year Totals"
  223.         exit repeat
  224.       end repeat
  225.       go card whatExpense
  226.       if the result = empty then doMenu "Delete Card"
  227.       pop card
  228.     end if
  229.     repeat with y = 1 to 3
  230.       if whatExpense is in field y of card "Expenses" then
  231.         repeat with i = 1 to the number of lines in field y of card "Expenses"
  232.           if whatExpense = line i of field y of card "Expenses" then
  233.             delete line i of field y of card "Expenses"
  234.             exit repeat
  235.           end if
  236.         end repeat
  237.         exit repeat
  238.       end if
  239.     end repeat
  240.     get line 16 of field 1 of card "Expenses"
  241.     if it = empty then
  242.       put line 1 of field 2 of card "Expenses" into line 16 of field 1 of card "Expenses"
  243.       delete line 1 of field 2 of card "Expenses"
  244.     end if
  245.     get line 16 of field 2 of card "Expenses"
  246.     if it = empty then
  247.       put line 1 of field 3 of card "Expenses" into line 16 of field 2 of card "Expenses"
  248.       delete line 1 of field 3 of card "Expenses"
  249.     end if
  250.     repeat with i = 1 to 3
  251.       get field i of card "Expenses"
  252.       if it Γëá empty then
  253.         repeat
  254.  
  255.           get field i of card "Expenses"
  256.           if it = empty then exit repeat
  257.  
  258.           get the number of lines of field i of card "Expenses"
  259.           put it into temp
  260.           get line temp of field i of card "Expenses"
  261.           if it = empty then
  262.             delete line temp of field i of card "Expenses"
  263.           else
  264.             exit repeat
  265.           end if
  266.         end repeat
  267.       end if
  268.     end repeat
  269.     repeat with x = 2 to 13
  270.       repeat with y = 1 to 4
  271.         if whatExpense is in field y of card x then
  272.           repeat with i = 1 to the number of lines in field y of card x
  273.             if whatExpense = line i of field y of card x then
  274.               delete line i of field y of card x
  275.               delete line i of field (y + 1) of card x
  276.               exit repeat
  277.             end if
  278.           end repeat
  279.           exit repeat
  280.         end if
  281.       end repeat
  282.       get line 15 of field 1 of card x
  283.       if it = empty then
  284.         put line 1 of field 3 of card x into line 15 of field 1 of card x
  285.         put line 1 of field 4 of card x into line 15 of field 2 of card x
  286.         delete line 1 of field 3 of card x
  287.         delete line 1 of field 4 of card x
  288.       end if
  289.     end repeat
  290.     hide msg
  291.   end if
  292. end mouseUp
  293.  
  294.  
  295.  
  296. -- part 65 (button)
  297. -- low flags: 00
  298. -- high flags: A002
  299. -- rect: left=195 top=18 right=37 bottom=280
  300. -- title width / last selected line: 0
  301. -- icon id / first selected line: 0 / 0
  302. -- text alignment: 1
  303. -- font id: 0
  304. -- text size: 12
  305. -- style flags: 0
  306. -- line height: 16
  307. -- part name: Enter Item
  308. ----- HyperTalk script -----
  309. on mouseUp
  310.   global moreExpenses
  311.   put 1 into moreExpenses
  312. end mouseUp
  313.  
  314.  
  315.  
  316. -- part 66 (button)
  317. -- low flags: 00
  318. -- high flags: A002
  319. -- rect: left=94 top=313 right=332 bottom=175
  320. -- title width / last selected line: 0
  321. -- icon id / first selected line: 0 / 0
  322. -- text alignment: 1
  323. -- font id: 0
  324. -- text size: 12
  325. -- style flags: 0
  326. -- line height: 16
  327. -- part name: Year Totals
  328. ----- HyperTalk script -----
  329. on mouseUp
  330.   visual barn door close slowly to gray
  331.   visual barn door open slowly
  332.   go card "Year Totals"
  333. end mouseUp
  334.  
  335.  
  336.  
  337. -- part 67 (button)
  338. -- low flags: 00
  339. -- high flags: 2000
  340. -- rect: left=1 top=5 right=45 bottom=40
  341. -- title width / last selected line: 0
  342. -- icon id / first selected line: 11030 / 11030
  343. -- text alignment: 1
  344. -- font id: 0
  345. -- text size: 12
  346. -- style flags: 0
  347. -- line height: 16
  348. -- part name: Home
  349. ----- HyperTalk script -----
  350. on mouseUp
  351.   visual barn door close slowly to gray
  352.   visual dissolve
  353.   go stack "Home"
  354. end mouseUp
  355.  
  356.  
  357.  
  358. -- part 68 (button)
  359. -- low flags: 00
  360. -- high flags: 0000
  361. -- rect: left=255 top=307 right=339 bottom=292
  362. -- title width / last selected line: 0
  363. -- icon id / first selected line: 20087 / 20087
  364. -- text alignment: 1
  365. -- font id: 0
  366. -- text size: 12
  367. -- style flags: 0
  368. -- line height: 16
  369. -- part name: NextCard
  370. ----- HyperTalk script -----
  371. on mouseUp
  372.   visual barn door close slowly to gray
  373.   visual barn door open slowly
  374.   go next card
  375. end mouseUp
  376.  
  377.  
  378.  
  379. -- part 69 (button)
  380. -- low flags: 00
  381. -- high flags: 0000
  382. -- rect: left=219 top=307 right=339 bottom=256
  383. -- title width / last selected line: 0
  384. -- icon id / first selected line: 20086 / 20086
  385. -- text alignment: 1
  386. -- font id: 0
  387. -- text size: 12
  388. -- style flags: 0
  389. -- line height: 16
  390. -- part name: PreviousCard
  391. ----- HyperTalk script -----
  392. on mouseUp
  393.   visual barn door close slowly to gray
  394.   visual barn door open slowly
  395.   go previous card
  396. end mouseUp
  397.  
  398.  
  399.  
  400. -- part 70 (button)
  401. -- low flags: 00
  402. -- high flags: 0000
  403. -- rect: left=462 top=307 right=339 bottom=499
  404. -- title width / last selected line: 0
  405. -- icon id / first selected line: 16816 / 16816
  406. -- text alignment: 1
  407. -- font id: 0
  408. -- text size: 12
  409. -- style flags: 0
  410. -- line height: 16
  411. -- part name: PopCard
  412. ----- HyperTalk script -----
  413. on mouseUp
  414.   visual barn door close slowly to gray
  415.   visual barn door open slowly
  416.   pop card
  417. end mouseUp
  418.  
  419.  
  420.  
  421. -- part 71 (field)
  422. -- low flags: 01
  423. -- high flags: 0002
  424. -- rect: left=365 top=314 right=332 bottom=441
  425. -- title width / last selected line: 0
  426. -- icon id / first selected line: 0 / 0
  427. -- text alignment: 65535
  428. -- font id: 3
  429. -- text size: 12
  430. -- style flags: 0
  431. -- line height: 16
  432. -- part name: subTotal
  433.  
  434.  
  435. -- part 74 (button)
  436. -- low flags: 00
  437. -- high flags: A002
  438. -- rect: left=370 top=18 right=37 bottom=482
  439. -- title width / last selected line: 0
  440. -- icon id / first selected line: 0 / 0
  441. -- text alignment: 1
  442. -- font id: 0
  443. -- text size: 12
  444. -- style flags: 0
  445. -- line height: 16
  446. -- part name: Change Amount
  447. ----- HyperTalk script -----
  448. --Copyright ┬⌐1988 - Scott McGilliard - all rights reserved
  449.  
  450. on mouseUp
  451.   set loc of msg to 18,15
  452.   put "Please click on the expense amount you want changed"
  453.   set cursor to 3
  454.   set numberFormat to "0.00"
  455.   repeat until the mouse is down
  456.   end repeat
  457.   hide msg
  458.   put item 1 of the mouseLoc into temp1
  459.   put item 2 of the mouseLoc into temp2
  460.   if temp1 >= 180 and temp1 <= 256 then
  461.     put "expense" into whichField
  462.     put "amount" into whichField2
  463.   else
  464.     if temp1 >= 416 and temp1 <= 492 then
  465.       put "expense2" into whichField
  466.       put "amount2" into whichField2
  467.     else
  468.       hide msg
  469.       exit mouseUp
  470.     end if
  471.   end if
  472.   put card field "allExpenses" of card "whichMonths" into allExpenses
  473.   put (temp2 - 39) div 16 into whichLine
  474.   put line whichLine of field whichField into whatExpense
  475.   put line whichLine of field whichField2 into newAmount
  476.   if whatExpense = empty then
  477.     hide msg
  478.     exit mouseUp
  479.   end if
  480.   ask "Please enter new amount for" && whatExpense with newAmount
  481.   if it = empty then
  482.     hide msg
  483.     exit mouseUp
  484.   else
  485.     if char 1 of it = "$" then delete char 1 of it
  486.     add 0 to it
  487.     put "$" & it into newAmount
  488.     if it = newAmount then
  489.       hide msg
  490.       exit mouseUp
  491.     end if
  492.   end if
  493.   set cursor to 4
  494.   set loc of msg to 19,106
  495.   put "Please wait"
  496.   get the short name of card
  497.   put it into monthName
  498.   repeat with i = 1 to the number of lines in allExpenses
  499.     if whatExpense = item 1 of line i of allExpenses then
  500.       put line i of card field "allExpenses" of card "whichMonths" into expenseInfo
  501.     else
  502.       next repeat
  503.     end if
  504.     if item 2 of expenseInfo = "variable" then
  505.       if whatExpense is in line 3 of card field "startMonth" of card "Year Totals" then
  506.         repeat with z = 1 to 12
  507.           if monthName = line z of field "months" of card whatExpense then exit repeat
  508.         end repeat
  509.         if item 2 of expenseInfo = "variable" then put newAmount into line z of field "actual" of card whatExpense
  510.       end if
  511.       repeat with z = 3 to the number of items in expenseInfo
  512.         if word 1 of item z of expenseInfo = monthName then
  513.           put newAmount into last word of item z of line i of card field "allExpenses" of card "whichMonths"
  514.           put newAmount into line whichLine of field whichField2
  515.           hide msg
  516.           exit mouseUp
  517.         end if
  518.       end repeat
  519.     else
  520.       put newAmount into item 2 of line i of card field "allExpenses" of card "whichMonths"
  521.       if whatExpense is in line 3 of card field "startMonth" of card "Year Totals" then
  522.         repeat with t = 1 to 12
  523.           if it = line t of field "months" of card whatExpense then exit repeat
  524.         end repeat
  525.         repeat with t = t to 12
  526.           get line t of field "amount" of card whatExpense
  527.           if it Γëá empty then put newAmount into line t of field "actual" of card whatExpense
  528.           put line t of field "months" of card whatExpense into x
  529.           repeat with y = 1 to 3
  530.             if whatExpense is in field y of card x then
  531.               repeat with i = 1 to the number of lines in field y of card x
  532.                 if whatExpense = line i of field y of card x then
  533.                   put newAmount into line i of field (y + 1) of card x
  534.                   exit repeat
  535.                 end if
  536.               end repeat
  537.               exit repeat
  538.             end if
  539.           end repeat
  540.         end repeat
  541.       else
  542.         if item 3 of expenseInfo = "Every Month" then
  543.           repeat with x = 2 to 13
  544.             repeat with y = 1 to 3
  545.               if whatExpense is in field y of card x then
  546.                 repeat with i = 1 to the number of lines in field y of card x
  547.                   if whatExpense = line i of field y of card x then
  548.                     put newAmount into line i of field (y + 1) of card x
  549.                     exit repeat
  550.                   end if
  551.                 end repeat
  552.                 exit repeat
  553.               end if
  554.             end repeat
  555.           end repeat
  556.         else
  557.           repeat with z = 3 to the number of items in expenseInfo
  558.             put item z of expenseInfo into x
  559.             repeat with y = 1 to 3
  560.               if whatExpense is in field y of card x then
  561.                 repeat with i = 1 to the number of lines in field y of card x
  562.                   if whatExpense = line i of field y of card x then
  563.                     put newAmount into line i of field (y + 1) of card x
  564.                     exit repeat
  565.                   end if
  566.                 end repeat
  567.                 exit repeat
  568.               end if
  569.             end repeat
  570.           end repeat
  571.         end if
  572.       end if
  573.     end if
  574.   end repeat
  575.   hide msg
  576. end mouseUp
  577.  
  578.  
  579.  
  580. -- part 75 (button)
  581. -- low flags: 00
  582. -- high flags: 2000
  583. -- rect: left=28 top=305 right=341 bottom=66
  584. -- title width / last selected line: 0
  585. -- icon id / first selected line: 26104 / 26104
  586. -- text alignment: 1
  587. -- font id: 0
  588. -- text size: 12
  589. -- style flags: 0
  590. -- line height: 16
  591. -- part name: HelpIndex
  592. ----- HyperTalk script -----
  593. on mouseUp
  594.   push card
  595.   helpIndex
  596. end mouseUp
  597.  
  598.  
  599.  
  600. -- part 76 (field)
  601. -- low flags: 81
  602. -- high flags: 2004
  603. -- rect: left=96 top=43 right=167 bottom=426
  604. -- title width / last selected line: 0
  605. -- icon id / first selected line: 0 / 0
  606. -- text alignment: 0
  607. -- font id: 3
  608. -- text size: 12
  609. -- style flags: 0
  610. -- line height: 16
  611. -- part name: ThirtyPlus
  612. ----- HyperTalk script -----
  613. on mouseUp
  614.   hide field "ThirtyPlus"
  615. end mouseUp
  616.  
  617.